package com.rabbitmq.demo.mq;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author :wn
 * @program : demo
 * @descript :
 * @create :2021-05-08 09:24
 */
@Component
public class SenderA {
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(String context) {
        System.out.println("Sender:" + context);
        amqpTemplate.convertAndSend("Queue1", context);
    }
}
